<template>
	<view class="rhead FlexRow">
		<view class="navItems  FlexColumn" v-for="(item, index) in navlist" @click="navclick(item)"
			:class="{'isActive' : dindex == index}">
			{{item.title}}
		</view>

	</view>
</template>

<script>
	export default {
		name: 'rhead',
		props: {
			dindex: {
				type: Number,
				default: 0,
			},
		},
		methods: {
			navclick(item) {
				let {
					path
				} = item
				uni.redirectTo({
					url: path,
				})
			},

		},
		data() {
			return {
				navlist: [{
						title: this.$zhTran('活动'),
						path: '/bundle2/pages/rebate/activity',
					},
					{
						title: this.$zhTran('收益'),
						path: '/bundle2/pages/rebate/income',
					},
				],
			}
		},
	}
</script>

<style lang="scss" scoped>
	.rhead {
		width: 100%;
		height: 100rpx;
		background: rgba(64, 115, 250, 1);

		.navItems:last-of-type {
			margin-right: 0;
		}

		.navItems {
			height: 100%;
			font-size: 30rpx;
			font-weight: 400;
			color: rgba(255, 255, 255, 1);
			text-align: center;
			vertical-align: top;
			// bordeR:solid 1px red;
			position: relative;
			margin-right: 200rpx;
		}

		.navItems.isActive::after {
			content: '';
			width: 34rpx;
			height: 6rpx;
			background: rgba(255, 255, 255, 1);
			position: absolute;
			bottom: 0;

		}
	}
</style>